package com.py.korona.db.model.base;

import android.text.TextUtils;

public class EntityProperty {
    private static volatile EntityProperty instance_;

    public static EntityProperty getInstance() {
        EntityProperty localInstance = instance_;
        if (null == localInstance) {
            synchronized (EntityProperty.class) {
                localInstance = instance_;
                if (null == localInstance) {
                    instance_ = localInstance = new EntityProperty();
                }
            }
        }
        return localInstance;
    }

    public static String nameOfField() {
        return "";
    }
    private String datatype;
    private String len;
    private String name;
    private String sqlInfo;

    public EntityProperty() {
        this.setSqlInfo(null);
        this.setName(null);
        this.setDatatype(null);
        this.setLen(null);
    }

    public EntityProperty(String name, String datatype, String len, String sqlInfo) {
        this.setSqlInfo(sqlInfo);
        this.setName(name);
        this.setDatatype(datatype);
        this.setLen(len);
    }

    public String asSQLDefinition() {
        StringBuilder sb = new StringBuilder();
        sb.append(" " + this.getName());
        sb.append(" " + this.getDatatype());
        if (!(TextUtils.isEmpty(this.getSqlInfo()))) {
            sb.append(" " + this.getSqlInfo());
        }
        return sb.toString();
    }

    public String getDatatype() {
        return datatype;
    }

    public String getLen() {
        return len;
    }

    public String getName() {
        return name;
    }

    private String getSqlInfo() {
        return sqlInfo;
    }

    private void setDatatype(String datatype) {
        this.datatype = datatype;
    }

    private void setLen(String len) {
        this.len = len;
    }

    private void setName(String name) {
        this.name = name;
    }

    private void setSqlInfo(String sqlInfo) {
        this.sqlInfo = sqlInfo;
    }
}
